package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.system.api.domain.RemoteSysBmType;
import com.ruoyi.system.api.factory.RemoteBmCodeFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 编码服务
 *
 * @author yy
 */
@FeignClient(contextId = "remoteBmCodeService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteBmCodeFallbackFactory.class)
public interface RemoteBmCodeService {

    @PostMapping(value = "/sysBmCode/genCode")
    RemoteSysBmType genCode(@RequestParam("sysBmId") Long sysBmId,@RequestParam("codeType") String codeType);

    @PostMapping(value = "/sysBmCode/genCodeWithAll")
    Map genCodeWithAll(@RequestParam("sysBmId") Long sysBmId);


    @PostMapping(value = "/sysBmCode/getCodeByGenCode")
    RemoteSysBmType getCodeByGenCode(@RequestParam(value = "genCode", required = false) String genCode, @RequestParam(value = "codeType", required = false) String codeType);

    @PostMapping(value = "/sysBmCode/genGoodsCode")
    RemoteSysBmType genGoodsCode(@RequestParam("sysBmId") Long sysBmId,@RequestParam("materialName") String materialName);

    @GetMapping(value = "/sysBmGoods/query")
    List<RemoteSysBmType> queryGoodsCode(@RequestBody RemoteSysBmType remoteSysBmType);
}
